package com.cdie.myschool.mapper.TeacherAwardsMapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.cdie.myschool.domain.dto.TeacherAwardsDTO;
import com.cdie.myschool.domain.entity.Awards;
import com.cdie.myschool.domain.entity.Calendar;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 雷金臣199000347
 * @date 2022/10/6 - 10:08
 */
@Mapper
@DS("master")
public interface TeacherAwardsMapper {
    @Select("select * from calendar where school_year=#{schoolYear} and semester=#{semester}")
    Calendar selectCalendar(String schoolYear,String semester);

    @Insert("insert into awards (semester_id,teacher_id,awards_day,awards_name,timestamp)" +
            "values(#{semesterId},#{teacherId},#{awardsDay},#{awardsName},#{timestamp})")
    int InsertTeacherAwards(Awards awards);

    @Select("select *from awards where semester_id=#{semesterId} and teacher_id=#{teacherGh}")
    List<Awards> getAwardsInfo(TeacherAwardsDTO teacherAwardsDTO);
}
